﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;

namespace Utility
{
    /// <summary>
    /// SystemTools
    /// </summary>
    public class SystemTools
    {
        #region  获得当前工作路径
        /// <summary>
        ///  获得当前工作路径
        /// </summary>
        /// <returns></returns>
        public static string GetCurrentDirectory()
        {
            string fullAppName = Assembly.GetExecutingAssembly().GetName().CodeBase;
            string fullAppPath = Path.GetDirectoryName(fullAppName);
            if (fullAppPath.StartsWith("file:"))
            {
                fullAppPath = fullAppPath.Substring(6);
            }
            return (fullAppPath);
        }
        #endregion
    }
}
